<%@ include file="/framework/purehead.jsp"%>
<%@ page import="java.util.*,system.until.*" %>
<%@ page contentType="text/html;charset=UTF-8"%> 

<%
ObjectList tList = MenuInfo.fetchbyParentCode(con);
ObjectList tSubList = MenuInfo.fetchSubs(con);
ArrayList alAffi = com.hitrust.gs.util.page.TopDisplay.getAffi(); 

%>
<html>
<head>
<LINK href="<%=Config.getWebPath()%>/css/css.css" rel="stylesheet" type="text/css">
<SCRIPT language=javascript src="<%=Config.getWebPath()%>/js/jquery.js"></SCRIPT>
<script language="JavaScript1.2">
	
	setInterval("refresh();",30000);

	function refresh(){
		$.ajax({
			url:"<%=response.encodeURL(Config.getWebPath() + "/servlet/RefreshServlet") %>"
		});
	}
	
    function control(cout,value){
        var temp
        for(var i=1; i<=cout; i++){
            if(i==value){
                temp = "Pan" + value;           
                eval("parent.menu.document.all." +temp+".style.display='block'");
            }else{
                temp = "Pan" + i;
                eval("parent.menu.document.all."+ temp+ ".style.display='none'");
            }
        }
    }
    
    function setIndex(){
        parent.main.location.href="blank.jsp";
        return false;
    }
    
    function setFont(cout,value){
        var temp ;
        var iCount = parseInt(cout);
        for(i=1; i<=parseInt(cout);i++){
            if(i==value){
                temp = "h"+value;
                eval("document.all." + temp + ".color='#CC0000'");
            }else{  
                temp = "h"+i;
                eval("document.all." + temp + ".color='#CEECFF';");
            }
        }
    }
    function doLogout()
    {
        if (confirm("确定要退出吗?"))
        {
            document.all("action_code").value = "logout";
            frm.submit();
        }
    }
   function doView(){
        document.all("action_code").value = "simpview";
        frm.submit();
   }
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0" >
  <tr > 
  <form id=frm action="<%=Config.getSrv()%>" method="post" target="_top">
  <input type=hidden name="action_code" value="">
    <td background="<%=Config.getWebPath()%>/images/h3.jpg"  >
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="34%"><img src="<%=Config.getWebPath()%>/images/h1.jpg" width="443" height="123"></td>
          <td width="36%" style="background-repeat: no-repeat"  background="<%=Config.getWebPath()%>/images/h2.jpg">
          	 <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                <tr> 
                  <td width="100%" valign="top"> 
                  	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	                      <tr valign="top"> 
	                        <td height="8"></td>
	                      </tr>
	                      <tr> 
	                        <td width="12%" height="29">&nbsp;</td>
	                        <td colspan="2" class="white-c"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	                            <tr> 
	                              <td width="88%" class="white-c">公告栏</td>
	                              <td width="12%"><img src="images/1-8.gif" width="9" height="9"></td>
	                            </tr>
	                          </table></td>
	                      </tr>
	                      <%for (int p=0; p< alAffi.size(); p++){ 
	                      		String[] tStr = (String[])alAffi.get(p);
	                      %>
	                      <tr> 
	                        <td>&nbsp;</td>
	                         <td width="45%" height="16" >
	                        <a href="<%= response.encodeURL(request.getContextPath() + "/A400909.do") %>?id=<%=tStr[0] %>" 
	                         	class="link8" target="_blank">
	                            <span style="color: #000066;"><%=tStr[1] %></span></a> 
	                        </td>
	                        <td width="42%">
	                        <a href="<%= response.encodeURL(request.getContextPath() + "/A400909.do") %>?id=<%=tStr[0] %>" 
	                         	class="link8" target="_blank">
	                            <span style="color: #000066;">[<%=tStr[3]%>]</span></a> 
	                        </td>
	                       
	                      </tr>
	                      <%} %>
	                      <tr> 
	                        <td height="16">&nbsp;</td>
	                        <td></td>
	                        <td height="16"></td>
	                      </tr>
                    </table>
                  </td>
                </tr>
               </table>
          </td>
          <td width="30%"><br>
            <table width="300" border="0" align="right" cellpadding="0" cellspacing="0">
              <tr class="css1"> 
                <td width="45%">您好：<%=loginInfo.getLoginUserName()%></td>
                <!-- <td width="25%">[帮助]</td> -->
                <td width="55%" class="linkwhite">[<a href="" onclick="setIndex();return false;">首页</a>]&nbsp;
                 <%//if(LoginContext.get(new SrvContext(request,response)).isView()){ %>
                 <!--  [<a href="" onclick="doView();return false;">简洁视图</a>]&nbsp;-->
                 <%//} %>
                [<a href="" onclick="doLogout();return false;">退出</a>]</td>
              </tr>
               <tr class="css1"> 
                <td colspan="2" class="linkwhite">
                	<%
                		LoginContext loginContext =(LoginContext)request.getSession().getAttribute("LoginContext");
                		if(loginContext.isProject()){
                	 %>
                	<a target="_parent"" href="<%=EnterUntil.getEnterUrl(request) %>">返回管理平台</a>
                	<%
                	 	}
                	 %>
                </td>
               
              </tr>
            </table>
            <div align="right"></div></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td background="<%=framework.core.Config.getWebPath()%>/images/t2.jpg" height="27">
    <TABLE height=24 cellSpacing=0 cellPadding=0 border=0>
              <TBODY>
                <TR align=middle> 
                  <TD width="10"><div align="right"><A href="index.htm"><STRONG></STRONG></A><font color="#FFFFFF">|</font></div></TD>
                  <%
                  if(tList.size()>0){
                      int count = 0;//tList.size();
                      String curUserId = loginInfo.getLoginUserId();
                      ObjectList list = UserMenuinfo.fetchbyUserId(curUserId,con);
                      for(int i=0;i<tList.size();i++){
                          MenuInfo mi = (MenuInfo)tList.get(i);                    
                          if(list.size()>0){
                              for(int k=0;k<list.size();k++){
                                  UserMenuinfo umi = (UserMenuinfo)list.get(k);
                                  //MenuInfo mi1 = MenuInfo.fetch(con,umi.getMenuId());
                                  MenuInfo mi1 = MenuInfo.getListSubById(tSubList,umi.getMenuId());
                                  if(mi1 != null){
                                      if(mi1.getParentCode() ==mi.getMenuCode()&&mi1.getParentCode()!=ConstDefine.VIEW_SWITCH_TOP){
                                          count++;
                                          break;
                                      }
                                  }
                              }
                          }

                      }
                      
                      int nums = 0;
                      for(int i=0;i<tList.size();i++){
                          MenuInfo mi = (MenuInfo)tList.get(i);

                          boolean isExist  = false;
                          if(list.size()>0){
                              for(int k=0;k<list.size();k++){
                                  UserMenuinfo umi = (UserMenuinfo)list.get(k);
                                  //MenuInfo mi1 = MenuInfo.fetch(con,umi.getMenuId());
                                  MenuInfo mi1 = MenuInfo.getListSubById(tSubList,umi.getMenuId());
                                  if(mi1 != null){
                                      if(mi1.getParentCode() ==mi.getMenuCode()&&mi1.getParentCode()!=ConstDefine.VIEW_SWITCH_TOP){
                                          isExist = true;
                                          nums++;
                                          break;

                                      }
                                  }
                                  
                              }
                          }
                          if(isExist){
                          %>
                          <TD width="165"><div align="center"><A href="#" onClick="control('<%=count%>','<%=nums%>');setFont('<%=count%>','<%=nums%>'); "><STRONG><font id="h<%=nums%>" color="<%=(nums==1)?"#CC0000":"CEECFF"%>"><%=mi.getMenuName()%></FONT></STRONG></A></div></TD>
                          <TD width="5"><font color="#FFFFFF">|</font></TD>

                        <%}                      

                      }
                  }
                  %>
                  <TD width="*">&nbsp;</TD>
                </TR>
              </TBODY>
            </TABLE>
    </td>
    </form>
    <form id="frm2">
    </form>
  </tr>
</table>
</body>
</html>
<%@ include file="/framework/purefoot.jsp"%>
